package tests.common.packets;

import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.ObjectOutputStream;

import sun.misc.BASE64Decoder;
import sun.misc.BASE64Encoder;

import common.packets.NOPPacket;

public class BinaryTest {

	public static final int LOGIN = 0x01;
	public static final int LOGIN_OK = 0x02;
	public static final int DISCONNECT = 0x0B;
	
	public static final int FUCKU_UP = 0xFF;
	
	public static void main(String[] args) throws IOException {
		
		BASE64Encoder be = new BASE64Encoder();
		BASE64Decoder bd = new BASE64Decoder();
		
		ByteArrayOutputStream baos = new ByteArrayOutputStream(4096);
		
		be.encode(XMLTest.class.getResourceAsStream("/tests/common/packets/test.xml"), baos );
		
//		System.out.println( baos.toString("UTF-8") );
		
		bd.decodeBufferToByteBuffer(new ByteArrayInputStream(baos.toByteArray()));
		
		NOPPacket np = new NOPPacket();
		
		ObjectOutputStream oos = new ObjectOutputStream(System.out);
		
		oos.writeObject(np);
		
		
	}
	
}
